
import { ref } from 'vue'
import { useIntersectionObserver } from '@vueuse/core'
const useInter = fn => {
  const target = ref(null)
  const { stop } = useIntersectionObserver(target, ([{ isIntersecting }]) => {
    if (isIntersecting) {
      stop()
      fn()
    }
  }, { threshold: 0.1 })
  return target
}
export {
  useInter
}
